package com.itheima.web2.controller;

import com.itheima.web2.pojo.Emp;
import com.itheima.web2.pojo.Result;
import com.itheima.web2.service.EmpService;
import com.itheima.web2.service.impl.EmpServiceA;
import com.itheima.web2.utils.XmlParserUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController//表示该类是一个控制器
public class EmpController {
    //业务层对象
    @Autowired
    private EmpService empService;
    @RequestMapping("/listEmp")
    public Result list(){
        //System.out.println(file);
        List<Emp> empList = empService.listEmp();

        //3. 响应数据
        return Result.success(empList);
    }
}